{extend name="common/base"/}
<!-- 主体 -->
{block name="body"}
<style>
.layui-td-gray {
    min-width: 200px;
}
.layui-form-label {
    width: 50px;
}
.layui-form-item .layui-input-inline {
    width: 150px;
}
</style>
<form class="layui-form p-4">
	<h3 class="pb-3">VIP设置</h3>
	<table class="layui-table layui-table-form">
		<tr>
			<td class="layui-td-gray-2">开启状态</td>
			<td colspan="5">
                {empty name="$config.open"}
                    <input type="radio" name="open" value="2" title="禁止">
                    <input type="radio" name="open" value="1" title="开启" checked>
                {else/}
                    <input type="radio" name="open" value="2" title="禁止"{eq name="$config.open" value="2"} checked{/eq}>
                    <input type="radio" name="open" value="1" title="开启"{eq name="$config.open" value="1"} checked{/eq}>
                {/empty}
            </td>
		</tr>
		<tr>
			<td class="layui-td-gray">等级价格</td>
			<td colspan="5">
                <div class="layui-form-item">
                    <div class="layui-input-inline layui-input-wrap">
                        {empty name="$config.level_1_day"}
                            <input type="text" value="" name="level_1_day" placeholder="请输入天数" class="layui-input">
                        {else/}
                            <input type="text" value="{$config.level_1_day}" name="level_1_day" placeholder="请输入天数" class="layui-input">
                        {/empty}
                    </div>
                    <div class="layui-form-mid layui-text-em">天</div>
                    <div class="layui-input-inline layui-input-wrap">
                        {empty name="$config.level_1"}
                            <input type="text" value="" name="level_1" placeholder="请输入价格" class="layui-input">
                        {else/}
                            <input type="text" value="{$config.level_1}" name="level_1" placeholder="请输入价格" class="layui-input">
                        {/empty}
                    </div>
                    <div class="layui-form-mid layui-text-em">元</div>
                </div>
                <div class="layui-form-item">
                    <div class="layui-input-inline layui-input-wrap">
                        {empty name="$config.level_2_day"}
                            <input type="text" value="" name="level_2_day" placeholder="请输入天数" class="layui-input">
                        {else/}
                            <input type="text" value="{$config.level_2_day}" name="level_2_day" placeholder="请输入天数" class="layui-input">
                        {/empty}
                    </div>
                    <div class="layui-form-mid layui-text-em">天</div>
                    <div class="layui-input-inline layui-input-wrap">
                        {empty name="$config.level_2"}
                            <input type="text" value="" name="level_2" placeholder="请输入价格" class="layui-input">
                        {else/}
                            <input type="text" value="{$config.level_2}" name="level_2" placeholder="请输入价格" class="layui-input">
                        {/empty}
                    </div>
                    <div class="layui-form-mid layui-text-em">元</div>
                </div>
                <div class="layui-form-item">
                    <div class="layui-input-inline layui-input-wrap">
                        {empty name="$config.level_3_day"}
                            <input type="text" value="" name="level_3_day" placeholder="请输入天数" class="layui-input">
                        {else/}
                            <input type="text" value="{$config.level_3_day}" name="level_3_day" placeholder="请输入天数" class="layui-input">
                        {/empty}
                    </div>
                    <div class="layui-form-mid layui-text-em">天</div>
                    <div class="layui-input-inline layui-input-wrap">
                        {empty name="$config.level_3"}
                            <input type="text" value="" name="level_3" placeholder="请输入价格" class="layui-input">
                        {else/}
                            <input type="text" value="{$config.level_3}" name="level_3" placeholder="请输入价格" class="layui-input">
                        {/empty}
                    </div>
                    <div class="layui-form-mid layui-text-em">元</div>
                </div>
                <div class="layui-form-item">
                    <div class="layui-input-inline layui-input-wrap">
                        {empty name="$config.level_4_day"}
                            <input type="text" value="" name="level_4_day" placeholder="请输入天数" class="layui-input">
                        {else/}
                            <input type="text" value="{$config.level_4_day}" name="level_4_day" placeholder="请输入天数" class="layui-input">
                        {/empty}
                    </div>
                    <div class="layui-form-mid layui-text-em">天</div>
                    <div class="layui-input-inline layui-input-wrap">
                        {empty name="$config.level_4"}
                            <input type="text" value="" name="level_4" placeholder="请输入价格" class="layui-input">
                        {else/}
                            <input type="text" value="{$config.level_4}" name="level_4" placeholder="请输入价格" class="layui-input">
                        {/empty}
                    </div>
                    <div class="layui-form-mid layui-text-em">元</div>
                </div>
                <div class="layui-form-item">
                    <div class="layui-input-inline layui-input-wrap">
                        {empty name="$config.level_5_day"}
                            <input type="text" value="" name="level_5_day" placeholder="请输入天数" class="layui-input">
                        {else/}
                            <input type="text" value="{$config.level_5_day}" name="level_5_day" placeholder="请输入天数" class="layui-input">
                        {/empty}
                    </div>
                    <div class="layui-form-mid layui-text-em">天</div>
                    <div class="layui-input-inline layui-input-wrap">
                        {empty name="$config.level_5"}
                            <input type="text" value="" name="level_5" placeholder="请输入价格" class="layui-input">
                        {else/}
                            <input type="text" value="{$config.level_5}" name="level_5" placeholder="请输入价格" class="layui-input">
                        {/empty}
                    </div>
                    <div class="layui-form-mid layui-text-em">元</div>
                </div>
                <div class="layui-form-item">
                    <div class="layui-input-inline layui-input-wrap">
                        {empty name="$config.level_6_day"}
                            <input type="text" value="" name="level_6_day" placeholder="请输入天数" class="layui-input">
                        {else/}
                            <input type="text" value="{$config.level_6_day}" name="level_6_day" placeholder="请输入天数" class="layui-input">
                        {/empty}
                    </div>
                    <div class="layui-form-mid layui-text-em">天</div>
                    <div class="layui-input-inline layui-input-wrap">
                        {empty name="$config.level_6"}
                            <input type="text" value="" name="level_6" placeholder="请输入价格" class="layui-input">
                        {else/}
                            <input type="text" value="{$config.level_6}" name="level_6" placeholder="请输入价格" class="layui-input">
                        {/empty}
                    </div>
                    <div class="layui-form-mid layui-text-em">元</div>
                </div>
			</td>
		</tr>       
	</table>
	<div class="py-3">
        <input type="hidden" name="id" value="{$id}">
		<button class="layui-btn layui-btn-normal" lay-submit="" lay-filter="webform">立即提交</button>
		<button type="reset" class="layui-btn layui-btn-primary">重置</button>
	</div>
</form>
{/block}
<!-- /主体 -->

<!-- 脚本 -->
{block name="script"}
<script>
	const moduleInit = ['tool'];
	function feiniaoInit() {
		var form = layui.form, tool = layui.tool;
		//监听提交
		form.on('submit(webform)', function (data) {
			let callback = function (e) {
				layer.msg(e.msg);
				if (e.code == 0) {
					parent.layui.tool.close(1000);
				}
			}
			tool.post("{:url('conf/edit')}", data.field, callback);
			return false;
		});
	}
</script>
{/block}
<!-- /脚本 -->